import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";

const router = createRouter({
  routes: [
    // {
    //   path: "/login",
    //   //路由到的地址(自定义)
    //   name: "login",
    //   //组件名称
    //   component: () => import("../views/login.vue"),
    //   //引入组件，HomeComponent.vue所在路径
    //   //HomeComponent.vue是需要路由的vue组件
    // },
    {
      path: "/layout",
      // redirect: "/read",
      component: () => import("../views/layout/Layout.vue"),
      children: [
        {
          path: "home",
          name: "home",
          component: () => import("../views/layout/home.vue"),
        },
        {
          path: "read",
          name: "read",
          component: () => import("../views/layout/read.vue"),
        },
      ],
    },
    {
      path: "/quickReading",
      name: "quickReading",
      component: () => import("../views/layout/home/quickReading.vue"),
    },
    {
      path: "/",
      name: "login",
      component: () => import("../views/login.vue"),
    },
    {
      path: "/register",
      name: "register",
      component: () => import("../views/register.vue"),
    },
    {
      path: "/readingBeans",
      name: "readingBeans",
      component: () => import("../views/layout/home/readingBeans.vue"),
    },
    {
      path: "/readMeAndReadHim",
      name: "readMeAndReadHim",
      component: () => import("../views/layout/home/readMeAndReadHim.vue"),
    },
    {
      path: "/article",
      name: "article",
      component: () => import("../views/layout/home/article.vue"),
    },
  ],
  history: createWebHashHistory(),
});
export default router;
